package com.example.demo.mapper;

import com.example.demo.entity.Post;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PostMapper {
    int insertPost(Post post);
    Post selectPostById(Long postId);
    List<Post> selectPostsByAuthorId(Long authorId);
    List<Post> selectAllPosts();
    int updatePost(Post post);
    int incrementLikeCount(Long postId);
    int decrementLikeCount(Long postId);
    int incrementCommentCount(Long postId);
    int deletePost(Long postId);
    int decrementCommentCount(Long postId);

}